package fenyu.personblob.bean.strategy.blob;

import fenyu.personblob.bean.databean.User;
import fenyu.personblob.bean.databean.blob.Blob;
import fenyu.personblob.bean.strategy.Strategy;
import fenyu.personblob.single.SinglePathDoor;

/**
 * create at 2018/12/22 11:22
 *
 * @author 纷羽 <gzj0078@gmail.com>
 */
public class SendBlobStrategy implements Strategy {

    @Override
    public Object todo(Object... args) {
        String tittle = (String) args[1];
        String text = (String) args[2];
        Blob blob = (Blob) SinglePathDoor.getSingleFuns().getAutoFactory().createBlob(null);
        blob.setSend_user(((User) args[0]).getId());
        blob.setText(text);
        blob.setTittle(tittle);
        blob = SinglePathDoor.getSingleSave().getSaveDoor().getBlobSavePath().save(blob);
        return blob;
    }

}
